Repository navigation
Conversation
|
|
20e4e61 to
20dc639
Compare
725cdc4 to
20dc639
Compare
|
Hi @Henrik-KM, thanks for the fix! I've adjusted things a little bit and could release this as |
| with patch.object(GaussianProcessSurrogate, "_fit") as fit: | ||
| with pytest.raises(IncompatibleSurrogateError, match="single-output"): | ||
| GaussianProcessSurrogate().fit(searchspace, objective, measurements) | ||
| fit.assert_not_called() |
There was a problem hiding this comment.
This reads a bit weird as you literally call a function called fit and then have fit.assert_not_called. Can we maybe rename the fit to internal_fit or similar?
|
|
||
| # Validate multi-target compatibility | ||
| if objective.is_multi_output and not self.supports_multi_output: | ||
| if objective._is_multi_model: |
There was a problem hiding this comment.
Shouldn't we specify in the docstring of this class that this is a Surrogate for single outputs? The docstring reads very general which is confusing.
There was a problem hiding this comment.
And it is also extra weird that there still is the support_multi_output attribute that a child could simply set to True, even though this is not possible. Or am I misunderstanding something here?
| if df.empty: | ||
| raise IncompleteMeasurementsError( | ||
| "Each modeled quantity requires at least one complete measurement. " | ||
| f"No complete measurements are available for '{name}'." |
There was a problem hiding this comment.
for DesirabilityObjective(pre_transform=True) this would say "there is not compelte measurement avaialble for desirability" which imo is not optimal. The specific target names should be emtnioned
|
|
||
| # Validate multi-target compatibility | ||
| if objective.is_multi_output and not self.supports_multi_output: | ||
| if objective._is_multi_model: |
There was a problem hiding this comment.
this is fishy
supports_multi_output declares a property of the surrogate class. Dropping and not self.supports_multi_output means fit now ignores that property, while _autoreplicate still relies on it. A surrogate declaring multi-output support would not be wrapped and would then always be rejected here. That no current surrogate sets the flag doesn't make the check correct.
Overall this PR makes way more incisions than I'd expect, the gut feelings ays the fix to this issue should be much simpler and not touch so many things...
Fixes #938.
The composite surrogate checks each modeled quantity for training observations before fitting any component. The resulting
IncompleteMeasurementsErrornames the quantities that need data. Discrete parameter transformations also retain their encoded columns when the input has zero rows, which preserves the computational schema of the hybrid input in the report.With BoTorch 0.18.1, the reproducer reached the outcome standardizer with no observations. Inspecting the same input showed that the discrete transform had dropped the categorical columns. The two regression tests cover the error and the schema independently.
Verification
OpenAI Codex prepared, implemented, and tested this change.